package com.w2cx.selenium.operate;

import com.w2cx.selenium.base.DriverBase;
import com.w2cx.selenium.page.MarkLibraryManagePage;
import org.openqa.selenium.WebElement;

import java.util.List;

public class MarkLibraryManageOperate {

    DriverBase driver;
    MarkLibraryManagePage mlmp;
    public MarkLibraryManageOperate(DriverBase driver){
        this.driver = driver;
        mlmp = new MarkLibraryManagePage(driver);
    }

    //点击“基础数据管理”菜单
    public void clickBaseDataManageMenu(){
        mlmp.click(mlmp.getBaseDataManageMenu());
    }


    //点击“标签库管理”菜单
    public void clickMarkLibraryManageMenu(){
        mlmp.click(mlmp.getMarkLibraryManageMenu());
    }

    //点击“添加”按钮
    public void clickAddBtn(){
        mlmp.click(mlmp.getMarkLibraryManageAddBtn());
    }

    //输入资讯标题
    public void inputInformationTitle(String title){
        mlmp.sendKeys(mlmp.getInformationTitleInput(),title);
    }

    //点击资讯分类下拉框
    public void clickInformationCategory(){
        mlmp.click(mlmp.getInformationCategory());
    }

    //选择一个资讯分类
    public void selectInformationCategory(){
        mlmp.click(mlmp.getInformationCatSelect());
    }

    //点击确认按钮
    public void clickConfirmBtn(){
        mlmp.click(mlmp.getReviewBtn());
    }

    //获取第一级标签列表
    public List<WebElement> getMarkLibraryLevel0List(){
       return mlmp.getMarkLibraryLevel0List();
    }

    //点击删除按钮
    public void clickDelBtn(WebElement fatherElement){
        //将所在行元素作为参数
        mlmp.click(mlmp.getDelBtn(fatherElement));


    }

    //点击确定按钮
    public void clickDelOkBtn(){
        mlmp.click(mlmp.getOkBtn());
    }


}
